<? /* license

BilugCMS (http://www.bilug.it) - Content Management System for dynamic web sites
Copyright (C) 2005-2008  Federico Villa and Alessio Loro Piana

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

For reference, contact bilugcms@vilnet.it


license */ ?>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.3.custom.css" rel="stylesheet" />	
		<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.7.3.custom.min.js"></script>
<style type="text/css">
	#tabs {
		width: 99%;
	}
	</style>
	<script type="text/javascript">
	$(function() {
		$("#tabs").tabs();
	});
	</script>
<?
echo "<h3> Gallerie </h3>
	<div id=\"tabs\">
	<ul>
        <li><a href=\"#fragment-1\"><span>Elenco</span></a></li>
        <li><a href=\"#fragment-2\"><span>Nuovo</span></a></li>
	</ul>             
	                
	<div id=\"fragment-1\">";
require_once("auth.php");
require_once("../utility/funzioni.php");
$argo = apici($_GET['argo']);
$dir='../gals/'.$argo;
if ($handle = opendir($dir)) {
	echo "<div class=\"contenitore\"><div class=\"azzerafloat\"></div>";
	$fileord = array();   
	while (false !== ($filenoord = readdir($handle))) 
	{
		$fileord[] = $filenoord;
	}
	natcasesort($fileord);      
   foreach ($fileord as $key => $value)   
	$files[] = $value;
	foreach ($files as $key => $file)
	{
			if ($file != '.' and $file != '..' and filetype($dir."/".$file) == 'dir')
         echo "<div class=\"evidenzia\">
           <div class=\"float300\">".str_replace("_"," ",substr($file,strpos($file,"_")+1))."</div> <!-- titolo -->
           <div class=\"float70\"><img src=\"./img/del.png\" id=\"ico\" /><a title=\"|Elimina la Galleria (eliminare prima le immagini presenti)\" href=\"del_gal.php?id=$file&amp;argo=$argo\">Elimina</a></div>
           <!-- Assegnamo all'id il valore che otteniamo con la query -->
           <div class=\"float70\"><img src=\"./img/mod.png\" id=\"ico\" /><a title=\"|Modifica il nome della galleria e la sua descrizione\" href=\"area.php?pag=insert_gal.php&amp;argo=$argo&amp;id=$file\">Modifica</a></div>
           <div class=\"float70\"><img src=\"./img/load.png\" id=\"ico\" /><a title=\"|Carica Immagini nella Galleria\" href=\"area.php?pag=uploadg.php&amp;argo=$argo&amp;id=$file\">Carica</a></div>
           <div class=\"float70\"><img src=\"./img/pre.png\" id=\"ico\" /><a title=\"|Gestisci le immagini della galleria (eliminazione)\" href=\"area.php?pag=listafile.php&amp;g=1&amp;dir=$dir/$file&amp;titolo=Immagini della Galleria ".str_replace("_"," ",substr($file,strpos($file,"_")+1))."\">Gestione</a></div>
           <div class=\"float100\"><img src=\"./img/cam.png\" id=\"ico\" /><a title=\"|Gestisci le descrizioni delle singole Immagini nella Galleria\" href=\"area.php?pag=elenco_fotogal.php&amp;argo=$argo&amp;id=$file\">&nbsp;&nbsp;Desc.Foto</a></div>
           <div class=\"float70\"><img src=\"./img/su.png\" id=\"ico\" /><a href=\"updown_gallerie.php?dir=U&amp;argo=$argo&amp;id=$file\">Alzare</a></div>
      	  <div class=\"float70\"><img src=\"./img/giu.png\" id=\"ico\" /><a href=\"updown_gallerie.php?dir=D&amp;argo=$argo&amp;id=$file\">Abbassa</a></div>
           <div class=\"azzerafloat\"></div></div>";
	}
	echo "</div><br>
	<img src=\"./img/ind.png\" id=\"ico\" /><a href=\"javascript:history.go(-1)\">Ritorna agli Argomenti</a>";
}
else
	{
	echo "<p>Nessuna Galleria</p>";
	}
echo "<br> </div>";
	
echo "<div id=\"fragment-2\">";
include ("insert_gal.php");
//include ("insert_gal.php&amp;argo=$argo");
echo "</div>";
closedir($handle); 
	
?>
